#include <stdio.h>
#include <stdlib.h>

struct stud_node {
     int    num;
     char   name[20];
     int    score;
     struct stud_node *next;
};
struct stud_node* input()
{
    struct stud_node *head = NULL, *tail = NULL, *new_node;
    new_node=NULL;
    while(1)
    {
        new_node=(struct stud_node*)malloc(sizeof(struct stud_node));
        scanf("%d",&new_node->num);
        if(new_node->num==0)
        {
            free(new_node);break;
        }
        scanf("%s%d",new_node->name,&new_node->score);
        new_node->next=NULL;
        if(head==NULL)
        {
            head = new_node;
            tail = new_node;
        }
        else
        {
            tail->next=new_node;
            tail=new_node;
        }
    }
    return head;
}

int main()
{
    struct stud_node *head, *p;
    
    head=input();
    for ( p = head; p != NULL; p = p->next )
        printf("%d %s %d\n", p->num, p->name, p->score);

    return 0;
}